const webpack = require('webpack');

const vendors = [
	'react',
	'react-dom',
	//  'jquery',
	// ...其它库
];

module.exports = {
	output: {
		path: 'public/js',
		filename: '[name].js',
		library: '[name]',
	},
	entry: {
		"lib": vendors,
	},
	plugins: [
		new webpack.optimize.UglifyJsPlugin({
			compress: {
				warnings: false,
			},
			output: {
				comments: false,
			},
		}),
		new webpack.DllPlugin({
			path: 'manifest.json',
			name: '[name]',
			context: __dirname,
		}),
		new webpack.DefinePlugin({
			'process.env': {
				'NODE_ENV': JSON.stringify('production')
			}
		}),
	],
};